CREFERENCE_GTK = `pkg-config --cflags --libs gtk+-2.0`
CREFERENCE_MYSQL = `mysql_config --cflags --libs`
login:login.o main_window.o talk_window.o socket_deal_with.o
	gcc $^ -o $@  $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)
	@if [ -d "./out/" ]; then \
		rm -r ./out/; \
	fi 
		mkdir ./out/; 
		mv *.o ./out/; 
login.o:login.c
	gcc -c $^ $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)

main_window.o:main_window.c
	gcc -c $^ $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)

talk_window.o:talk_window.c
	gcc -c $^ $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)

socket_deal_with.o:socket_deal_with.c
	gcc -c $^ $(CREFERENCE_GTK) $(CREFERENCE_MYSQL)

clean:
	rm -r ./out/
	rm -r login
